<?php

namespace backend\controllers;

use Yii;
use yii\web\Controller;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use common\models\Admin;

class UserController extends controller
{

    public function actionUserlogin()
    {
        $model = new Admin();
        $model->setPassword('root');
        var_dump($model);
    }
    public function actionTest(){
//        $time=date('Y/m/d H:m:s');
//        $time=time();
        echo time();
    }
    public function actionEmail()
    {
        $mail= Yii::$app->mailer->compose();
        $mail->setTo('1552475473@qq.com');
        $mail->setSubject("邮件测试");
        //$mail->setTextBody('zheshisha ');   //发布纯文字文本
        $mail->setHtmlBody("yii2发邮件测试");    //发布可以带html标签的文本
        if($mail->send())
            echo "success";
        else
            echo "failse";
        die();
    }
}

?>